<html>
 <head>
  <meta charset="utf-8"/>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
  <title>
   karlqi的回复  | 数螺 | NAUT IDEA
  </title>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" rel="stylesheet"/>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
  <style type="text/css">
   #xmain img {
                  max-width: 100%;
                  display: block;
                  margin-top: 10px;
                  margin-bottom: 10px;
                }

                #xmain p {
                    line-height:150%;
                    font-size: 16px;
                    margin-top: 20px;
                }

                #xmain h2 {
                    font-size: 24px;
                }

                #xmain h3 {
                    font-size: 20px;
                }

                #xmain h4 {
                    font-size: 18px;
                }


                .header {
	           background-color: #0099ff;
	           color: #ffffff;
	           margin-bottom: 20px;
	        }

	        .header p {
                  margin: 0px;
                  padding: 10px 0;
                  display: inline-block;  
                  vertical-align: middle;
                  font-size: 16px;
               }

               .header a {
                 color: white;
               }

              .header img {
                 height: 25px;
              }
  </style>
  <script src="http://cdn.bootcss.com/jquery/3.0.0/jquery.min.js">
  </script>
  <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript">
   MathJax.Hub.Config({elements: ["bbpress-forums"]});
  </script>
  <script src="http://nautstatic-10007657.file.myqcloud.com/static/css/readability.min.js" type="text/javascript">
  </script>
  <script type="text/javascript">
   $(document).ready(function() {
                 var loc = document.location;
                 var uri = {
                  spec: "http://cos.name/cn/profile/7484/replies/page/8/",
                  host: "http://cos.name",
                  prePath: "http://cos.name",
                  scheme: "http",
                  pathBase: "http://cos.name/"
                 };
    
                 var documentClone = document.cloneNode(true);
                 var article = new Readability(uri, documentClone).parse();
     
                 document.getElementById("xmain").innerHTML = article.content;
                });
  </script>
  <!-- 1466466845: Accept with keywords: (title(0.0):论坛, topn(0.266666666667):RSS订阅,帖子,开源,作者,会员,文件,用户名,主站,急需,普通,源代码,数据,收藏夹,底层,函数,项目,楼主,检验,密码,总计,C++,拟合,命令,网站,主题,原程序,算法,论坛,软件,讨论区).-->
 </head>
 <body class="bbp-user-page single singular bbpress paged-8 single-author sidebar" onload="">
  <div class="header">
   <div class="container">
    <div class="row">
     <div class="col-xs-6 col-sm-6 text-left">
      <a href="/databee">
       <img src="http://nautidea-10007657.cos.myqcloud.com/logo_white.png"/>
      </a>
      <a href="/databee">
       <p>
        数螺
       </p>
      </a>
     </div>
     <div class="hidden-xs col-sm-6 text-right">
      <p>
       致力于数据科学的推广和知识传播
      </p>
     </div>
    </div>
   </div>
  </div>
  <div class="container text-center">
   <h1>
    karlqi的回复
   </h1>
  </div>
  <div class="container" id="xmain">
   <div class="hfeed site" id="page">
    <header class="site-header" id="masthead" role="banner">
     <div id="cos-logo">
      <a href="http://cos.name/cn">
       <img src="http://cos.name/cn/wp-content/themes/COS-forest/images/headers/cos-logo.png"/>
      </a>
     </div>
     <div class="navbar" id="navbar">
      <nav class="navigation main-navigation" id="site-navigation" role="navigation">
       <h3 class="menu-toggle">
        菜单
       </h3>
       <div class="menu-%e8%8f%9c%e5%8d%951-container">
        <ul class="nav-menu" id="menu-%e8%8f%9c%e5%8d%951">
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-407772" id="menu-item-407772">
          <a href="http://cos.name/cn/">
           论坛首页
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-407773" id="menu-item-407773">
          <a href="http://cos.name/cn/forums/">
           讨论区
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-407774" id="menu-item-407774">
          <a href="http://cos.name/cn/wp-login.php?action=register">
           注册
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-407819" id="menu-item-407819">
          <a href="http://cos.name/">
           主站
          </a>
         </li>
        </ul>
       </div>
      </nav>
      <!-- #site-navigation -->
     </div>
     <!-- #navbar -->
    </header>
    <!-- #masthead -->
    <div class="site-main" id="main">
     <div class="content-area" id="primary">
      <div class="site-content" id="content" role="main">
       <article class="post-0 type- status-publish hentry" id="post-0">
        <header class="entry-header">
         <h1 class="entry-title">
          karlqi
         </h1>
        </header>
        <!-- .entry-header -->
        <div class="entry-content">
         <div id="bbpress-forums">
          <div id="bbp-user-wrapper">
           <div id="bbp-single-user-details">
            <div id="bbp-user-avatar">
             <span class="vcard">
              <a class="url fn n" href="http://cos.name/cn/profile/7484/" rel="me" title="karlqi">
               <img src="http://sdn.geekzu.org/avatar/f5edfdb127d930ad1ca1450a7654dfb6?s=150&amp;d=monsterid&amp;r=g"/>
              </a>
             </span>
            </div>
            <!-- #author-avatar -->
            <div id="bbp-user-navigation">
             <ul>
              <li class="">
               <span class="vcard bbp-user-profile-link">
                <a class="url fn n" href="http://cos.name/cn/profile/7484/" rel="me" title="karlqi的档案">
                 档案
                </a>
               </span>
              </li>
              <li class="">
               <span class="bbp-user-topics-created-link">
                <a href="http://cos.name/cn/profile/7484/topics/" title="karlqi发起的主题">
                 发起的主题
                </a>
               </span>
              </li>
              <li class="current">
               <span class="bbp-user-replies-created-link">
                <a href="http://cos.name/cn/profile/7484/replies/" title="karlqi创建的回复">
                 创建的回复
                </a>
               </span>
              </li>
              <li class="">
               <span class="bbp-user-favorites-link">
                <a href="http://cos.name/cn/profile/7484/favorites/" title="karlqi的收藏夹">
                 收藏夹
                </a>
               </span>
              </li>
             </ul>
            </div>
            <!-- #bbp-user-navigation -->
           </div>
           <!-- #bbp-single-user-details -->
           <div id="bbp-user-body">
            <div class="bbp-user-replies-created" id="bbp-user-replies-created">
             <h2 class="entry-title">
              回复的主题
             </h2>
             <div class="bbp-user-section">
              <div class="bbp-pagination">
               <div class="bbp-pagination-count">
                查看 15 个帖子 - 106 到 120（总计 127 个）
               </div>
               <div class="bbp-pagination-links">
                <a class="prev page-numbers" href="http://cos.name/cn/profile/7484/replies/page/7/">
                 ←
                </a>
                <a class="page-numbers" href="http://cos.name/cn/profile/7484/replies/">
                 1
                </a>
                <span class="page-numbers dots">
                 …
                </span>
                <a class="page-numbers" href="http://cos.name/cn/profile/7484/replies/page/7/">
                 7
                </a>
                <span class="page-numbers current">
                 8
                </span>
                <a class="page-numbers" href="http://cos.name/cn/profile/7484/replies/page/9/">
                 9
                </a>
                <a class="next page-numbers" href="http://cos.name/cn/profile/7484/replies/page/9/">
                 →
                </a>
               </div>
              </div>
              <ul class="forums bbp-replies" id="topic-0-replies">
               <li class="bbp-header">
                <div class="bbp-reply-author">
                 作者
                </div>
                <!-- .bbp-reply-author -->
                <div class="bbp-reply-content">
                 帖子
                </div>
                <!-- .bbp-reply-content -->
               </li>
               <!-- .bbp-header -->
               <li class="bbp-body">
                <div class="bbp-reply-header" id="post-241681">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2008年1月14日 上午12:44
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/9356/">
                    VC++中调用 R 的函数
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/9356/#post-241681">
                   4 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-241681 -->
                <div class="odd bbp-parent-forum-999 bbp-parent-topic-9356 bbp-reply-position-4 user-id-7484 post-241681 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   <img src="http://sdn.geekzu.org/avatar/f5edfdb127d930ad1ca1450a7654dfb6?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   karlqi
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   R是开源的，其内核的实现函数无非是C++ codes或是Fortan codes。
                   <br/>
                   在开发VC++项目时，如果只想用某几个特定的R函数(该函数又不依赖于其他底层函数或仅仅只依赖几个底层函数)的话，与其在VC++中调用R函数，还不如直接提取C++ codes，或者提取由Fortan codes转换而来C++ codes，直接嵌入到你自己的VC++项目中。如果出于种种原因非要调用，当然也是可以的，无非就是把R调用其自己的底层.c .f 文件的过程(通过R API)再重复一遍而已。所以在楼主提到的文献Writing R Extensions中并不是说“using VC++ to call R function”而是说“R API:entry points for C code”(R的API函数:C code的入口点)，这两者是不同的。说道底，你调用的只是R function底下的C codes。是C调C而不是C调R,唯一不同是后一种方法不用为底层函数的依赖关系操心了；不过话说回来，谁都不愿意开发一个自己的VC++项目还非要人家装个R不可。所以玩玩可以，实际不推荐楼主的做法。
                   <br/>
                   如果还要坚持做，做法比较繁琐了，首先得下载Rtools，用make.exe把Rmath.dll等文件重新编译出来，后面的事帮助里说的很清楚了，不多啰嗦了。
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-241634">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2008年1月13日 上午4:14
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/9394/">
                    多元超球面均匀分配如何产生？
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/9394/#post-241634">
                   2 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-241634 -->
                <div class="even bbp-parent-forum-999 bbp-parent-topic-9394 bbp-reply-position-2 user-id-7484 post-241634 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   <img src="http://sdn.geekzu.org/avatar/f5edfdb127d930ad1ca1450a7654dfb6?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   karlqi
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   何必用R package呢？ 自己写一个函数就可以了啊。利用Hypersphere Point Picking 算法，可以简单的得到。
                   <br/>
                   关于Hypersphere Point Picking算法，请参考以下资源：
                  </p>
                  <p>
                   <a class="d4pbbc-url" href="http://mathworld.wolfram.com/HyperspherePointPicking.html" rel="nofollow" target="_blank">
                    http://mathworld.wolfram.com/HyperspherePointPicking.html
                   </a>
                  </p>
                  <p>
                   虽然不知道R package中哪个函数实现了此功能，不过这么古老的算法，想必是早就实现了的，有时间的话可以尝试一下。Hypersphere Point Picking算法很方便实现，后来1959年，Hicks又做了改进，提高了计算效率。下面的参考文献有关于此的细节。
                  </p>
                  <p>
                   Hicks, J. S. ad Wheeling, R. F. "An Efficient Method for Generating Uniformly Distributed Points on the Surface of an n-Dimensional Sphere." Comm. Assoc. Comput. Mach. 2, 13-15, 1959.
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-241597">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2008年1月12日 上午8:55
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/492/">
                    世界上最牛的宾馆
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/492/page/4/#post-241597">
                   47 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-241597 -->
                <div class="odd bbp-parent-forum-1001 bbp-parent-topic-492 bbp-reply-position-47 user-id-7484 post-241597 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   <img src="http://sdn.geekzu.org/avatar/f5edfdb127d930ad1ca1450a7654dfb6?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   karlqi
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   好啊
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-241595">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2008年1月12日 上午8:35
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/7661/">
                    对电脑笑了二十分钟的帖子
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/7661/page/5/#post-241595">
                   73 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-241595 -->
                <div class="even bbp-parent-forum-1001 bbp-parent-topic-7661 bbp-reply-position-73 user-id-7484 post-241595 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   <img src="http://sdn.geekzu.org/avatar/f5edfdb127d930ad1ca1450a7654dfb6?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   karlqi
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-241594">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2008年1月12日 上午8:33
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/7659/">
                    亲爱的，2008-我们要饭吧！！
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/7659/page/2/#post-241594">
                   19 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-241594 -->
                <div class="odd bbp-parent-forum-1001 bbp-parent-topic-7659 bbp-reply-position-19 user-id-7484 post-241594 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   <img src="http://sdn.geekzu.org/avatar/f5edfdb127d930ad1ca1450a7654dfb6?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   karlqi
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-241591">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2008年1月12日 上午7:33
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/9391/">
                    急需！分布拟合检验的命令，在R实现
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/9391/#post-241591">
                   5 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-241591 -->
                <div class="even bbp-parent-forum-999 bbp-parent-topic-9391 bbp-reply-position-5 user-id-7484 post-241591 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   <img src="http://sdn.geekzu.org/avatar/f5edfdb127d930ad1ca1450a7654dfb6?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   karlqi
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   直接看ks.test的代码：
                  </p>
                  <p>
                   function (x, y, …, alternative = c("two.sided", "less", "greater"),
                   <br/>
                   exact = NULL)
                   <br/>
                   {
                   <br/>
                   pkolmogorov1x &lt;- function(x, n) {
                   <br/>
                   if (x &lt;= 0)
                   <br/>
                   return(0)
                   <br/>
                   if (x &gt;= 1)
                   <br/>
                   return(1)
                   <br/>
                   j &lt;- seq.int(from = 0, to = floor(n * (1 – x)))
                   <br/>
                   1 – x * sum(exp(lchoose(n, j) + (n – j) * log(1 – x –
                   <br/>
                   j/n) + (j – 1) * log(x + j/n)))
                   <br/>
                   }
                   <br/>
                   alternative &lt;- match.arg(alternative)
                   <br/>
                   DNAME &lt;- deparse(substitute(x))
                   <br/>
                   x &lt;- x[!is.na(x)]
                   <br/>
                   n &lt;- length(x)
                   <br/>
                   if (n &lt; 1)
                   <br/>
                   stop("not enough 'x' data")
                   <br/>
                   PVAL &lt;- NULL
                   <br/>
                   if (is.numeric(y)) {
                   <br/>
                   DNAME &lt;- paste(DNAME, "and", deparse(substitute(y)))
                   <br/>
                   y &lt;- y[!is.na(y)]
                   <br/>
                   n.x &lt;- as.double(n)
                   <br/>
                   n.y &lt;- length(y)
                   <br/>
                   if (n.y &lt; 1)
                   <br/>
                   stop("not enough 'y' data")
                   <br/>
                   if (is.null(exact))
                   <br/>
                   exact &lt;- (n.x * n.y &lt; 10000)
                   <br/>
                   METHOD &lt;- "Two-sample Kolmogorov-Smirnov test"
                   <br/>
                   TIES &lt;- FALSE
                   <br/>
                   n &lt;- n.x * n.y/(n.x + n.y)
                   <br/>
                   w &lt;- c(x, y)
                   <br/>
                   z &lt;- cumsum(ifelse(order(w) &lt;= n.x, 1/n.x, -1/n.y))
                   <br/>
                   if (length(unique(w)) &lt; (n.x + n.y))  {
                   <br/>
                   <strong class="d4pbbc-bold">
                    warning("cannot compute correct p-values with ties")
                   </strong>
                   <br/>
                   z &lt;- z[c(which(diff(sort(w)) != 0), n.x + n.y)]
                   <br/>
                   TIES &lt;- TRUE
                   <br/>
                   }
                   <br/>
                   STATISTIC &lt;- switch(alternative, two.sided = max(abs(z)),
                   <br/>
                   greater = max(z), less = -min(z))
                   <br/>
                   nm_alternative &lt;- switch(alternative, two.sided = "two-sided",
                   <br/>
                   less = "the CDF of x lies below that of y", greater = "the CDF of x lies above that of y")
                   <br/>
                   if (exact &amp;&amp; (alternative == "two.sided") &amp;&amp; !TIES)
                   <br/>
                   PVAL &lt;- 1 – .C("psmirnov2x", p = as.double(STATISTIC),
                   <br/>
                   as.integer(n.x), as.integer(n.y), PACKAGE = "stats")$p
                   <br/>
                   }
                   <br/>
                   else {
                   <br/>
                   if (is.character(y))
                   <br/>
                   y &lt;- get(y, mode = "function")
                   <br/>
                   if (mode(y) != "function")
                   <br/>
                   stop("'y' must be numeric or a string naming a valid function")
                   <br/>
                   if (is.null(exact))
                   <br/>
                   exact &lt;- (n &lt; 100)
                   <br/>
                   METHOD &lt;- "One-sample Kolmogorov-Smirnov test"
                   <br/>
                   TIES &lt;- FALSE
                   <br/>
                   if (length(unique(x)) &lt; n) {
                   <br/>
                   <strong class="d4pbbc-bold">
                    warning("cannot compute correct p-values with ties")
                   </strong>
                   <br/>
                   TIES &lt;- TRUE
                   <br/>
                   }
                   <br/>
                   x &lt;- y(sort(x), …) – (0:(n – 1))/n
                   <br/>
                   STATISTIC &lt;- switch(alternative, two.sided = max(c(x,
                   <br/>
                   1/n – x)), greater = max(1/n – x), less = max(x))
                   <br/>
                   if (exact &amp;&amp; !TIES) {
                   <br/>
                   PVAL &lt;- if (alternative == "two.sided")
                   <br/>
                   1 – .C("pkolmogorov2x", p = as.double(STATISTIC),
                   <br/>
                   as.integer(n), PACKAGE = "stats")$p
                   <br/>
                   else 1 – pkolmogorov1x(STATISTIC, n)
                   <br/>
                   }
                   <br/>
                   nm_alternative &lt;- switch(alternative, two.sided = "two-sided",
                   <br/>
                   less = "the CDF of x lies below the null hypothesis",
                   <br/>
                   greater = "the CDF of x lies above the null hypothesis")
                   <br/>
                   }
                   <br/>
                   names(STATISTIC) &lt;- switch(alternative, two.sided = "D",
                   <br/>
                   greater = "D^+", less = "D^-")
                   <br/>
                   pkstwo &lt;- function(x, tol = 1e-06) {
                   <br/>
                   if (is.numeric(x))
                   <br/>
                   x &lt;- as.vector(x)
                   <br/>
                   else stop("argument 'x' must be numeric")
                   <br/>
                   p &lt;- rep(0, length(x))
                   <br/>
                   p[is.na(x)] &lt;- NA
                   <br/>
                   IND &lt;- which(!is.na(x) &amp; (x &gt; 0))
                   <br/>
                   if (length(IND) &gt; 0) {
                   <br/>
                   p[IND] &lt;- .C("pkstwo", as.integer(length(x[IND])),
                   <br/>
                   p = as.double(x[IND]), as.double(tol), PACKAGE = "stats")$p
                   <br/>
                   }
                   <br/>
                   return(p)
                   <br/>
                   }
                   <br/>
                   if (is.null(PVAL)) {
                   <br/>
                   PVAL &lt;- ifelse(alternative == "two.sided", 1 – pkstwo(sqrt(n) *
                   <br/>
                   STATISTIC), exp(-2 * n * STATISTIC^2))
                   <br/>
                   }
                   <br/>
                   RVAL &lt;- list(statistic = STATISTIC, p.value = PVAL, alternative = nm_alternative,
                   <br/>
                   method = METHOD, data.name = DNAME)
                   <br/>
                   class(RVAL) &lt;- "htest"
                   <br/>
                   return(RVAL)
                   <br/>
                   }
                  </p>
                  <p>
                   即可发现原因。再具体就要看data4和x是什么了，以后最好把数据dump出来一并贴上，方便解决问题。
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-241585">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2008年1月12日 上午6:22
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/9391/">
                    急需！分布拟合检验的命令，在R实现
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/9391/#post-241585">
                   2 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-241585 -->
                <div class="odd bbp-parent-forum-999 bbp-parent-topic-9391 bbp-reply-position-2 user-id-7484 post-241585 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   <img src="http://sdn.geekzu.org/avatar/f5edfdb127d930ad1ca1450a7654dfb6?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   karlqi
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   可以调用 ks.test 和 chisq.test （函数ks.test 就是S+中的ks.gof）
                   <br/>
                   具体的用法直接用?ks.test 和 ?chisq.test看 R 的帮助好了。
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-241579">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2008年1月12日 上午5:31
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/2716/">
                    爱因斯坦 《我的世界观》
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/2716/#post-241579">
                   10 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-241579 -->
                <div class="even bbp-parent-forum-1002 bbp-parent-topic-2716 bbp-reply-position-10 user-id-7484 post-241579 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   <img src="http://sdn.geekzu.org/avatar/f5edfdb127d930ad1ca1450a7654dfb6?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   karlqi
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   赞同这种世间观
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-241567">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2008年1月12日 上午1:04
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/9390/">
                    查看R函数的原程序
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/9390/#post-241567">
                   4 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-241567 -->
                <div class="odd bbp-parent-forum-999 bbp-parent-topic-9390 bbp-reply-position-4 user-id-7484 post-241567 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   <img src="http://sdn.geekzu.org/avatar/f5edfdb127d930ad1ca1450a7654dfb6?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   karlqi
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   R既然是开源软件自然可以找到源代码，到CRAN上下载源代码包，比如R-2.6.1.tar.gz，解压后找到目录：
                   <br/>
                   ..\R-2.6.1\src\library\stats\R\下的qqnorm.R文件，一切OK。
                  </p>
                  <p>
                   qqnorm &lt;- function(y, …) UseMethod("qqnorm")
                  </p>
                  <p>
                   qqnorm.default &lt;-
                   <br/>
                   function(y, ylim, main="Normal Q-Q Plot",
                   <br/>
                   xlab="Theoretical Quantiles", ylab="Sample Quantiles",
                   <br/>
                   plot.it=TRUE, datax = FALSE, …)
                   <br/>
                   {
                   <br/>
                   if(has.na &lt;- any(ina &lt;- is.na(y))) { ## keep NA's in proper places
                   <br/>
                   yN &lt;- y
                   <br/>
                   y &lt;- y[!ina]
                   <br/>
                   }
                   <br/>
                   if(0 == (n &lt;- length(y)))
                   <br/>
                   stop("y is empty or has only NAs")
                   <br/>
                   if (plot.it &amp;&amp; missing(ylim))
                   <br/>
                   ylim &lt;- range(y)
                   <br/>
                   x &lt;- qnorm(ppoints(n))[order(order(y))]
                   <br/>
                   if(has.na) {
                   <br/>
                   y &lt;- x; x &lt;- yN; x[!ina] &lt;- y
                   <br/>
                   y &lt;- yN
                   <br/>
                   }
                   <br/>
                   if(plot.it)
                   <br/>
                   if (datax)
                   <br/>
                   plot(y, x, main= main, xlab= ylab, ylab=xlab, xlim = ylim, …)
                   <br/>
                   else
                   <br/>
                   plot(x, y, main= main, xlab= xlab, ylab= ylab, ylim= ylim, …)
                   <br/>
                   invisible(if(datax) list(x = y, y = x) else list(x = x, y = y))
                   <br/>
                   }
                  </p>
                  <p>
                   R真是好用啊。
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-241563">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2008年1月12日 上午12:53
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/9388/">
                    apply的返回值
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/9388/#post-241563">
                   2 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-241563 -->
                <div class="even bbp-parent-forum-999 bbp-parent-topic-9388 bbp-reply-position-2 user-id-7484 post-241563 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   <img src="http://sdn.geekzu.org/avatar/f5edfdb127d930ad1ca1450a7654dfb6?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   karlqi
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   以下是apply的函数体，简单分析一下就很清楚了；若拿具体的数据调试一下就更清楚了。
                   <br/>
                   apply &lt;- function(X, MARGIN, FUN, …)
                   <br/>
                   {
                   <br/>
                   if(is.character(FUN))
                   <br/>
                   FUN &lt;- getFunction(FUN)
                   <br/>
                   else if(mode(FUN) != "function") {
                   <br/>
                   farg &lt;- substitute(FUN)
                   <br/>
                   if(mode(farg) == "name")
                   <br/>
                   FUN &lt;- getFunction(farg)
                   <br/>
                   else stop(paste("\"", farg, "\" is not a function", sep = ""))
                   <br/>
                   }
                   <br/>
                   if(is.character(MARGIN)) {
                   <br/>
                   MARGIN &lt;- pmatch(MARGIN, names(dimnames(X)), nomatch = NA)
                   <br/>
                   if(length(which.na(MARGIN)))
                   <br/>
                   stop("bad name(s) in MARGIN")
                   <br/>
                   }
                   <br/>
                   d &lt;- dim(X)
                   <br/>
                   if((dlen &lt;- length(d)) == 0)
                   <br/>
                   stop("dim(X) must have a positive length")
                   <br/>
                   if(is(X, "Matrix")) {
                   <br/>
                   X &lt;- array(as.vector(X), dim(X), dimnames(X))
                   <br/>
                   }
                   <br/>
                   else {
                   <br/>
                   if(dlen == 2) {
                   <br/>
                   X &lt;- as.matrix(X)
                   <br/>
                   if(is.loaded(symbol.C("S_matrix_apply"))) {
                   <br/>
                   ans &lt;- .Call("S_matrix_apply", X, MARGIN, FUN, list(…), COPY
                   <br/>
                   = c(F, F, F, F), CLASSES = NULL)
                   <br/>
                   if(length(ans) &gt; 0)
                   <br/>
                   return(ans)
                   <br/>
                   }
                   <br/>
                   }
                   <br/>
                   else X &lt;- as.array(X)
                   <br/>
                   }
                   <br/>
                   dn &lt;- dimnames(X)
                   <br/>
                   if(!is.null(dn)) {
                   <br/>
                   dn.call &lt;- dn[ – MARGIN]
                   <br/>
                   dn &lt;- dn[MARGIN]
                   <br/>
                   dimnames(X) &lt;- NULL
                   <br/>
                   }
                   <br/>
                   else {
                   <br/>
                   dn.call &lt;- NULL
                   <br/>
                   }
                   <br/>
                   newX &lt;- aperm(X, c((1:dlen)[ – MARGIN], MARGIN))
                   <br/>
                   subdim &lt;- d[ – MARGIN]
                   <br/>
                   dim(newX) &lt;- c(prod(subdim), prod(d[MARGIN]))
                   <br/>
                   p &lt;- dim(newX)[2]
                   <br/>
                   if(length(subdim) &gt; 1) {
                   <br/>
                   ans &lt;- lapply(seq(len = p), function(i, FUN, newX, subdim, dn.call, …)
                   <br/>
                   FUN(array(newX[, i], subdim, dn.call), …), FUN, newX, subdim, dn.call, …)
                   <br/>
                   }
                   <br/>
                   else {
                   <br/>
                   # convert matrix into list, with each column becoming list element
                   <br/>
                   # then use fast lapply.
                   <br/>
                   newd &lt;- dim(newX)
                   <br/>
                   if(length(dn.call[[1]]) &gt; 0) {
                   <br/>
                   # must attach names to columns before applying FUN
                   <br/>
                   # just in case FUN uses names of data.
                   <br/>
                   ans &lt;- lapply(split(newX, rep.int(1:newd[2], rep.int(newd[1], newd[
                   <br/>
                   2]))), function(X, .NAMES, FUN, …)
                   <br/>
                   {
                   <br/>
                   names(X) &lt;- .NAMES
                   <br/>
                   FUN(X, …)
                   <br/>
                   }
                   <br/>
                   , .NAMES = dn.call[[1]], FUN, …)
                   <br/>
                   }
                   <br/>
                   else ans &lt;- lapply(split(newX, rep.int(1:newd[2], rep.int(newd[1], newd[2]))),
                   <br/>
                   FUN, …)
                   <br/>
                   }
                   <br/>
                   ans.names &lt;- names(ans[[1]])
                   <br/>
                   ret.list &lt;- is.recursive(ans[[1]])
                   <br/>
                   first.length &lt;- length(ans[[1]])
                   <br/>
                   if(!ret.list)
                   <br/>
                   ret.list &lt;- any(unlist(lapply(ans, length)) != first.length)
                   <br/>
                   if(!ret.list)
                   <br/>
                   ans &lt;- unlist(ans, recursive = F)
                   <br/>
                   if(length(MARGIN) == 1 &amp;&amp; length(ans) == p) {
                   <br/>
                   if(length(dn[[1]]) &gt; 0)
                   <br/>
                   names(ans) &lt;- dn[[1]]
                   <br/>
                   else names(ans) &lt;- NULL
                   <br/>
                   return(ans)
                   <br/>
                   }
                   <br/>
                   else if(length(ans) == p)
                   <br/>
                   return(array(ans, d[MARGIN], dn))
                   <br/>
                   else if(length(ans) &gt; 0 &amp;&amp; length(ans) %% p == 0) {
                   <br/>
                   if(is.null(dn))
                   <br/>
                   return(array(ans, c(length(ans)/p, d[MARGIN])))
                   <br/>
                   else return(array(ans, c(length(ans)/p, d[MARGIN]), c(list(ans.names), dn)))
                   <br/>
                   }
                   <br/>
                   else return(ans)
                   <br/>
                   }
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-241506">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2008年1月11日 上午8:53
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/5611/">
                    招募各路英雄好汉开始整理我们的论坛资料、制作COS月刊
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/5611/page/6/#post-241506">
                   84 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-241506 -->
                <div class="odd bbp-parent-forum-986 bbp-parent-topic-5611 bbp-reply-position-84 user-id-7484 post-241506 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   <img src="http://sdn.geekzu.org/avatar/f5edfdb127d930ad1ca1450a7654dfb6?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   karlqi
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   报名结束了吗？ 我想参加，一点数学背景，一点计算机背景，在某外企工作，使用R/S+/C++/Java开发统计软件，英语和LaTex应该够用，希望能参与。112470554 (QQ)
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-241496">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2008年1月11日 上午6:08
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/9372/">
                    请教关于“非整合陈列”
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/9372/#post-241496">
                   2 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-241496 -->
                <div class="even bbp-parent-forum-999 bbp-parent-topic-9372 bbp-reply-position-2 user-id-7484 post-241496 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   <img src="http://sdn.geekzu.org/avatar/f5edfdb127d930ad1ca1450a7654dfb6?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   karlqi
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   改成
                   <br/>
                   Sg=(t(b)%*%G)/ as.numeric(sqrt(t(b)%*%G%*%V))
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-241494">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2008年1月11日 上午5:54
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/9368/">
                    有什么好的方法比较这两个矩阵中的值
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/9368/#post-241494">
                   3 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-241494 -->
                <div class="odd bbp-parent-forum-999 bbp-parent-topic-9368 bbp-reply-position-3 user-id-7484 post-241494 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   <img src="http://sdn.geekzu.org/avatar/f5edfdb127d930ad1ca1450a7654dfb6?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   karlqi
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   写个循环就好了，如下
                   <br/>
                   ans &lt;- matrix(nrow = 1, ncol = 27)
                   <br/>
                   for(i in 1:27){
                   <br/>
                   ans[1,i] &lt;- nrow(x[x[,72+i] &lt;= y[i,13],])
                   <br/>
                   }
                   <br/>
                   ans
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-241425">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2008年1月10日 上午9:10
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/9308/">
                    如何在数个条件下, 计算数据个数
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/9308/#post-241425">
                   4 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-241425 -->
                <div class="even bbp-parent-forum-999 bbp-parent-topic-9308 bbp-reply-position-4 user-id-7484 post-241425 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   <img src="http://sdn.geekzu.org/avatar/f5edfdb127d930ad1ca1450a7654dfb6?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   karlqi
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   同上
                   <br/>
                   nrow(DF[DF[,"x"] == "B" &amp; DF[,"y"] == "F" &amp; !is.na(DF[,"z"]),])
                   <br/>
                   即可
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-241421">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2008年1月10日 上午8:10
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/9343/">
                    学习R的网站，推荐一下
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/9343/#post-241421">
                   8 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-241421 -->
                <div class="odd bbp-parent-forum-999 bbp-parent-topic-9343 bbp-reply-position-8 user-id-7484 post-241421 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   <img src="http://sdn.geekzu.org/avatar/f5edfdb127d930ad1ca1450a7654dfb6?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/7484/" rel="nofollow" title="查看karlqi的档案">
                   karlqi
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   非常不错的， 建议把这个网站打包成一个.chm拿出来分享就更好了
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
               </li>
               <!-- .bbp-body -->
               <li class="bbp-footer">
                <div class="bbp-reply-author">
                 作者
                </div>
                <div class="bbp-reply-content">
                 帖子
                </div>
                <!-- .bbp-reply-content -->
               </li>
               <!-- .bbp-footer -->
              </ul>
              <!-- #topic-0-replies -->
              <div class="bbp-pagination">
               <div class="bbp-pagination-count">
                查看 15 个帖子 - 106 到 120（总计 127 个）
               </div>
               <div class="bbp-pagination-links">
                <a class="prev page-numbers" href="http://cos.name/cn/profile/7484/replies/page/7/">
                 ←
                </a>
                <a class="page-numbers" href="http://cos.name/cn/profile/7484/replies/">
                 1
                </a>
                <span class="page-numbers dots">
                 …
                </span>
                <a class="page-numbers" href="http://cos.name/cn/profile/7484/replies/page/7/">
                 7
                </a>
                <span class="page-numbers current">
                 8
                </span>
                <a class="page-numbers" href="http://cos.name/cn/profile/7484/replies/page/9/">
                 9
                </a>
                <a class="next page-numbers" href="http://cos.name/cn/profile/7484/replies/page/9/">
                 →
                </a>
               </div>
              </div>
             </div>
            </div>
            <!-- #bbp-user-replies-created -->
           </div>
          </div>
         </div>
        </div>
        <!-- .entry-content -->
        <footer class="entry-meta">
        </footer>
        <!-- .entry-meta -->
       </article>
       <!-- #post -->
      </div>
      <!-- #content -->
     </div>
     <!-- #primary -->
     <div class="sidebar-container" id="tertiary" role="complementary">
      <div class="sidebar-inner">
       <div class="widget-area">
        <aside class="widget bbp_widget_login" id="bbp_login_widget-2">
         <h3 class="widget-title">
          登录
         </h3>
         <form action="http://cos.name/cn/wp-login.php" class="bbp-login-form" method="post">
          <fieldset>
           <legend>
            登录
           </legend>
           <div class="bbp-username">
            <label for="user_login">
             用户名:
            </label>
           </div>
           <div class="bbp-password">
            <label for="user_pass">
             密码:
            </label>
           </div>
           <div class="bbp-remember-me">
            <label for="rememberme">
             记住用户名
            </label>
           </div>
           <div class="bbp-submit-wrapper">
            <button class="button submit user-submit" id="user-submit" name="user-submit" tabindex="104" type="submit">
             登录
            </button>
           </div>
           <div class="bbp-login-links">
            <a class="bbp-register-link" href="http://cos.name/cn/wp-login.php?action=register" title="注册">
             注册
            </a>
            <a class="bbp-lostpass-link" href="http://cos.name/cn/wp-login.php?action=lostpassword" title="忘记密码">
             忘记密码
            </a>
           </div>
          </fieldset>
         </form>
        </aside>
        <aside class="widget widget_text" id="text-7">
         <h3 class="widget-title">
          搜索
         </h3>
         <div class="textwidget">
          <form action="http://www.google.com/search" id="bbp-search-form" method="get" onsubmit="Gsitesearch(this)" role="search">
           <div>
           </div>
          </form>
          <form id="bbp-search-form-baidu" onsubmit="g(this)" role="search">
           <div>
           </div>
          </form>
         </div>
        </aside>
        <aside class="widget widget_text" id="text-2">
         <h3 class="widget-title">
          新鲜事
         </h3>
         <div class="textwidget">
          <ul>
           <li>
            <a href="http://cos.name/cn/topics/">
             最新帖子
            </a>
           </li>
           <li>
            <a href="http://cos.name/cn/view/popular/">
             最热门主题
            </a>
           </li>
           <li>
            <a href="http://cos.name/cn/view/no-replies/">
             消灭零回复
            </a>
           </li>
          </ul>
         </div>
        </aside>
        <aside class="widget widget_text" id="text-3">
         <h3 class="widget-title">
          RSS订阅
         </h3>
         <div class="textwidget">
          <ul>
           <li>
            <img src="http://cos.name/wp-includes/images/rss.png"/>
            <a href="http://cos.name/cn/topics/feed/">
             所有主题
            </a>
           </li>
           <li>
            <img src="http://cos.name/wp-includes/images/rss.png"/>
            <a href="http://cos.name/cn/forums/feed/">
             所有帖子
            </a>
           </li>
          </ul>
         </div>
        </aside>
       </div>
       <!-- .widget-area -->
      </div>
      <!-- .sidebar-inner -->
     </div>
     <!-- #tertiary -->
    </div>
    <!-- #main -->
    <footer class="site-footer" id="colophon" role="contentinfo">
     <div class="site-info">
      版权所有 © 2014 统计之都 | 由
      <a href="http://wordpress.org/">
       WordPress
      </a>
      构建 | 主题修改自
      <a href="http://wordpress.org/themes/twentythirteen">
       Twenty Thirteen
      </a>
     </div>
     <!-- .site-info -->
    </footer>
    <!-- #colophon -->
   </div>
   <!-- #page -->
  </div>
 </body>
</html>